﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLogicLayer;
using System.Collections;

namespace logicunivesityinventorystore.Department
{
    public partial class SetTemporaryRepresentative : System.Web.UI.Page
    {
        DepartmentFacade dfc = new DepartmentFacade();
        EmployeeFacade efc = new EmployeeFacade();
        Employee emp;
        //set here for the employee id from session
        string empid;
        protected void Page_Load(object sender, EventArgs e)
        {
           // Session["UserName"] = "A0102939A";
            empid = User.Identity.Name;
            //CalendarExtender1.StartDate = DateTime.Now;
        }

        protected void btnSet_Click(object sender, EventArgs e)
        {
            efc = new EmployeeFacade();
            emp = efc.FindEmployeeByName(ddlEmpName.SelectedItem.Text);
            DateTime sDate = Convert.ToDateTime(txtToDate.Text);
            DateTime eDate = Convert.ToDateTime(txtFromDate.Text);
            dfc.setTempRep(emp.Departmentcode, emp.EmployeeID, sDate, eDate);
            Response.Redirect("~/Department/HomePage_Department.aspx");
        }
    }
}